#coding=utf-8
from django.db import models
from django.contrib.auth.models import User
from vote.models import Vote

class ConversationManager(models.Manager):
	pass
 
class Conversation(models.Model):
    vote = models.ForeignKey(Vote)
    user = models.ForeignKey(User)
    content = models.TextField()
    created_time = models.DateTimeField(auto_now_add=True)

    class Meta:
        verbose_name = u'对话'
        verbose_name_plural = u'对话列表'
        db_table = "t_conversation"
        ordering = ["created_time"]
    
    def save(self):
        created = False
        if not self.id:
            created = True
        super(Conversation, self).save()
        if created:
            pass # do some thing